<template>
  <div>
    <FullScreenLoading :show="loadingStore.isLoading" />

    <NuxtLayout name="default">
      <keepalive>
        <NuxtPage />
      </keepalive>

    </NuxtLayout>
  </div>
</template>

<script setup>
import { useLoadingStore } from "~/stores/loading";
import { onMounted } from 'vue';
const keepalive = {
  include: ["about"],
};


const loadingStore = useLoadingStore(); // 必须加括号，返回store实例
import { useNuxtApp } from '#app';
const nuxtApp = useNuxtApp();

onMounted(async () => {
  try {
    const res = await nuxtApp.$api.get('/articles');
    console.log('articles:', res.data);
  } catch (error) {
    console.error('获取 /articles 失败:', error);
  }
});
</script>

<style></style>
